//
//  GroupBuying.m
//  10-团购
//
//  Created by wangneihan on 15/12/18.
//  Copyright © 2015年 wangneihan. All rights reserved.
//

#import "GroupBuying.h"

@implementation GroupBuying

-(instancetype)initWithDic:(NSDictionary *)dic{
    if (self = [self init]) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+(instancetype)groupBuyingWithDic:(NSDictionary *)dic{
    return  [[self alloc] initWithDic:dic];
}

+(NSMutableArray *)groupBuyingsList{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"tgs" ofType:@"plist"];
    NSArray *array = [NSArray arrayWithContentsOfFile:path];
    NSMutableArray *resultArray = [[NSMutableArray alloc]init];
    for (NSDictionary *tempDic in array) {
        GroupBuying *tempGb = [GroupBuying groupBuyingWithDic:tempDic];
        [resultArray addObject:tempGb];
    }
    return resultArray;
}

@end
